﻿//using EponaAdventures.CaravanAbilities;
//using RimWorld;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
//using UnityEngine;
//using Verse;

//namespace Meow
//{
//    public class HediffCompProperties_EponaFast : HediffCompProperties
//    {
//        public HediffCompProperties_EponaFast()
//        {
//            compClass = typeof(HediffComp_ConjuredLight);
//        }
//    }

//    public class HediffComp_ConjuredLight : HediffComp
//    {
//        private int ticks = 0;

//        private int ticksToDisappear = 0;

//        private Thing light;

//        private int fleckTicks;

//        public HediffCompProperties_EponaFast Props => (HediffCompProperties_EponaFast)props;

//        public override string CompTipStringExtra => base.CompTipStringExtra + $"  - Caravan travel speed: x{Math.Round(ModSettings.magicLightCaravanSpeedMult, 1)}";

//        public override void CompPostPostRemoved()
//        {
//            base.CompPostPostRemoved();
//            if (CaravanMagicLight.magicLightTravelers.Contains(base.Pawn))
//            {
//                CaravanMagicLight.magicLightTravelers.Remove(base.Pawn);
//            }

//            if (light != null)
//            {
//                light.Destroy();
//            }
//        }

//        public override void CompPostTick(ref float severityAdjustment)
//        {
//            base.CompPostTick(ref severityAdjustment);
//            if (ticks > 500)
//            {
//                ticks = 0;
//                if (!CaravanMagicLight.magicLightTravelers.Contains(base.Pawn))
//                {
//                    CaravanMagicLight.magicLightTravelers.Add(base.Pawn);
//                }
//            }

//            fleckTicks++;
//            ticks++;
//            ticksToDisappear++;
//        }

//        private Vector3 GetNewRandomPosAroundPos(Vector3 pos, float radius = 2f)
//        {
//            return pos + new Vector3(Rand.Range(0f - radius, radius), 0f, Rand.Range(0f - radius, radius));
//        }

//        private int GetForwardCellByPawnSpeed()
//        {
//            float num = base.Pawn?.GetStatValue(StatDefOf.MoveSpeed) ?? 5f;
//            if (!(num < 8f))
//            {
//                return (int)((double)num * 2.5);
//            }

//            return (int)(num * 2f);
//        }

//        public override void CompExposeData()
//        {
//            base.CompExposeData();
//            Scribe_Deep.Look(ref light, "light", null);
//            Scribe_Values.Look(ref ticks, "ticks", 0);
//            Scribe_Values.Look(ref ticksToDisappear, "ticksToDisappear", 0);
//        }
//    }
//}
